/**
 * Copyright 2011 Adrian Witas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.abstractmeta.code.g.core.code;

import org.abstractmeta.code.g.code.*;
import com.google.common.base.Preconditions;

import javax.annotation.Nonnull;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.*;


/**
 * Provides implementation of interface org.abstractmeta.toolbox.code.JavaType
 * This class has been auto generated by g-toolbox.
 */
public class JavaTypeImpl implements JavaType {

    private final List<JavaField> fields;

    private final List<JavaMethod> methods;

    private final Set<Type> importTypes;

    private final List<JavaConstructor> constructors;

    private final List<Type> superInterfaces;

    private final String packageName;

    private final JavaKind kind;

    private final List<String> body;

    private final Type superType;

    private final List<JavaType> nestedJavaTypes;

    private final List<JavaModifier> modifiers;

    private final String name;
    
    private final String simpleName;

    private final List<Annotation> annotations;

    private final List<String> documentation;

    private final boolean nested;
    
    private final List<Type> genericTypeArguments;

    private final Map<String, Type> genericTypeVariables;

    private final  Collection<String> classPathDependencies;
    
    public JavaTypeImpl(List<JavaField> fields, List<JavaMethod> methods, List<JavaConstructor> constructors, Set<Type> importTypes, List<Type> superInterfaces, @Nonnull String packageName, @Nonnull JavaKind kind, List<String> body, Type superType, List<JavaType> nestedJavaTypes, List<JavaModifier> modifiers, @Nonnull String name, List<Annotation> annotations, List<String> documentation, boolean nested, String simpleName, List<Type> genericTypeArguments, Map<String, Type> genericTypeVariables, Collection<String> classPathDependencies) {
        this.fields = fields;
        this.methods = methods;
        this.constructors = constructors;
        this.importTypes = importTypes;
        this.superInterfaces = superInterfaces;
        this.packageName = packageName;
        this.kind = kind;
        this.body = body;
        this.superType = superType;
        this.nestedJavaTypes = nestedJavaTypes;
        this.modifiers = modifiers;
        this.genericTypeArguments = genericTypeArguments;
        this.genericTypeVariables = genericTypeVariables;
        this.classPathDependencies = classPathDependencies;
        this.name = Preconditions.checkNotNull(name, "name was null");;
        this.annotations = annotations;
        this.documentation = documentation;
        this.nested = nested;
        this.simpleName = simpleName;
    }

    public List<JavaField> getFields() {
        return this.fields;
    }


    public List<JavaMethod> getMethods() {
        return this.methods;
    }


    public List<JavaConstructor> getConstructors() {
        return this.constructors;
    }

    public List<Type> getSuperInterfaces() {
        return this.superInterfaces;
    }

    public String getPackageName() {
        return this.packageName;
    }

    @Override
    public Set<Type> getImportTypes() {
        return importTypes;
    }

    public JavaKind getKind() {
        return this.kind;
    }

    public List<String> getBodyLines() {
        return this.body;
    }


    public Type getSuperType() {
        return this.superType;
    }

    public List<JavaType> getNestedJavaTypes() {
        return this.nestedJavaTypes;
    }

    @Override
    public Collection<String> getClassPathDependencies() {
        return classPathDependencies;
    }

    public List<JavaModifier> getModifiers() {
        return this.modifiers;
    }

    public String getName() {
        return this.name;
    }

    @Override
    public String getSimpleName() {
        return simpleName;
    }

    @Override
    public Map<String, Type> getGenericTypeVariables() {
        return genericTypeVariables;
    }

    @Override
    public List<Type> getGenericTypeArguments() {
        return genericTypeArguments;
    }

    public List<Annotation> getAnnotations() {
        return this.annotations;
    }

    public List<String> getDocumentation() {
        return this.documentation;
    }

    public boolean isNested() {
        return nested;
    }

}